load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "sessioninit",
    srcs = [
        "cache.go",
        "constants.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/sessioninit",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/security/password",
        "//pkg/security/username",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/tree",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "@com_github_go_ldap_ldap_v3//:ldap",
    ],
)

go_test(
    name = "sessioninit_test",
    srcs = [
        "cache_test.go",
        "main_test.go",
    ],
    deps = [
        ":sessioninit",
        "//pkg/base",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/sql",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//require",
    ],
)
